using System.Data;
using Oracle.ManagedDataAccess.Client;

namespace OracleInternal.BulkCopy
{
	internal class BulkCopySourceDataTable : BulkCopySourceDataRows
	{
		internal DataRowState m_rowState;

		internal BulkCopySourceDataTable(DataTable dt, OracleBulkCopy bulkCopy, int requestedBatchSize, DataRowState rowState)
			: base(dt, bulkCopy, requestedBatchSize)
		{
			m_rowState = rowState;
		}

		internal BulkCopySourceDataTable(DataTable dt, OracleBulkCopy bulkCopy, int requestedBatchSize)
			: base(dt, bulkCopy, requestedBatchSize)
		{
			m_rowState = (DataRowState)0;
		}

		internal override bool CheckRowState(DataRow dataRow)
		{
			if ((dataRow.RowState & DataRowState.Deleted) == 0)
			{
				if (m_rowState != 0)
				{
					return (dataRow.RowState & m_rowState) != 0;
				}
				return true;
			}
			return false;
		}
	}
}
